package org.intrasearch.spider;

import org.intrasearch.core.ArtifactId;

public class SpiderMapTaskInput
{
    final VirtualFile dir;
    final ArtifactId parentDirId;

    public SpiderMapTaskInput(VirtualFile dir, ArtifactId parentDirId)
    {
        this.dir = dir;
        this.parentDirId = parentDirId;
    }

    public SpiderMapTaskInput(VirtualFile dir)
    {
        this(dir, null);
    }

    @Override
    public boolean equals(Object o)
    {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        SpiderMapTaskInput that = (SpiderMapTaskInput) o;

        return dir.equals(that.dir) && !(parentDirId != null ? !parentDirId.equals(that.parentDirId) : that.parentDirId != null);

    }

    @Override
    public int hashCode()
    {
        int result = dir.hashCode();
        result = 31 * result + (parentDirId != null ? parentDirId.hashCode() : 0);
        return result;
    }
}
